package com.tigercel.xiangchengyun.ui.activities

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.LinearLayoutManager
import android.view.View
import com.tigercel.xiangchengyun.R
import com.tigercel.xiangchengyun.adapter.MyCollectionAdapter
import com.tigercel.xiangchengyun.entity.MyCollectionsEntity
import kotlinx.android.synthetic.main.activity_my_collections.*
import kotlinx.android.synthetic.main.include_titlebar.*

class MyCollectionsActivity : AppCompatActivity() {
    private lateinit var entities: MutableList<MyCollectionsEntity>
    private lateinit var adapter: MyCollectionAdapter
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_my_collections)
        entities = ArrayList()
        titlebar_tv.text = "我的收藏"
        titlebar_iv_left.visibility = View.VISIBLE
        titlebar_iv_left.setImageResource(R.drawable.btn_nav_back)
        titlebar_iv_left.setOnClickListener(View.OnClickListener { this.finish() })
        for (i in 0..6) {
            var entity = MyCollectionsEntity("", "测试收藏标题", "12:36", "263", "今日头条")
            entities.add(entity)
        }
        var layoutManager = LinearLayoutManager(this)
        adapter = MyCollectionAdapter(R.layout.item_my_collection, entities)
        myCollectionRecyclerView.layoutManager = layoutManager
        myCollectionRecyclerView.adapter = adapter
    }
}
